local mumu = fk.CreateSkill {
  name = "lingling__mumu",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["lingling__mumu"] = "穆穆",
  [":lingling__mumu"] = "锁定技，当你不因此失去/获得牌后，你摸其中【闪】/【杀】数的牌。",
}

mumu:addEffect(fk.AfterCardsMove, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(mumu.name) then
      local n = 0
      for _, move in ipairs(data) do
        if move.to == player and move.skillName ~= mumu.name and move.toArea == Card.PlayerHand then
          for _, info in ipairs(move.moveInfo) do
            if Fk:getCardById(info.cardId).trueName == "slash" then
              n = n + 1
            end
          end
        end
        if move.from == player and move.skillName ~= mumu.name then
          for _, info in ipairs(move.moveInfo) do
            if Fk:getCardById(info.cardId).trueName == "jink" and info.fromArea == Card.PlayerHand then
              n = n + 1
            end
          end
        end
      end
      if n > 0 then
        event:setCostData(self, {choice = n})
        return true
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(event:getCostData(self).choice, mumu.name)
  end,
})

return mumu
